package com.scau402.system.service.impl;

import java.util.List;

import com.scau402.common.annotation.DataScope;
import com.scau402.common.utils.DateUtils;
import com.scau402.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.scau402.system.mapper.WmsStreamHostMapper;
import com.scau402.system.domain.WmsStreamHost;
import com.scau402.system.service.IWmsStreamHostService;

/**
 * 直播间主播Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-06-26
 */
@Service
public class WmsStreamHostServiceImpl implements IWmsStreamHostService 
{
    @Autowired
    private WmsStreamHostMapper wmsStreamHostMapper;

    /**
     * 查询直播间主播
     * 
     * @param id 直播间主播主键
     * @return 直播间主播
     */
    @Override
    public WmsStreamHost selectWmsStreamHostById(Long id)
    {
        return wmsStreamHostMapper.selectWmsStreamHostById(id);
    }

    /**
     * 查询直播间主播列表
     * 
     * @param wmsStreamHost 直播间主播
     * @return 直播间主播
     */
    @Override
    @DataScope(tenantAlias = "t", userAlias = "u")
    public List<WmsStreamHost> selectWmsStreamHostList(WmsStreamHost wmsStreamHost)
    {
        wmsStreamHost.setTenantId(SecurityUtils.getLoginUser().getTenantId());
        return wmsStreamHostMapper.selectWmsStreamHostList(wmsStreamHost);
    }

    /**
     * 新增直播间主播
     * 
     * @param wmsStreamHost 直播间主播
     * @return 结果
     */
    @Override
    @DataScope(tenantAlias = "t", userAlias = "u")
    public int insertWmsStreamHost(WmsStreamHost wmsStreamHost)
    {
        wmsStreamHost.setCreateTime(DateUtils.getNowDate());
        wmsStreamHost.setTenantId(SecurityUtils.getLoginUser().getTenantId());
        return wmsStreamHostMapper.insertWmsStreamHost(wmsStreamHost);
    }

    /**
     * 修改直播间主播
     * 
     * @param wmsStreamHost 直播间主播
     * @return 结果
     */
    @Override
    @DataScope(tenantAlias = "t", userAlias = "u")
    public int updateWmsStreamHost(WmsStreamHost wmsStreamHost)
    {
        wmsStreamHost.setUpdateTime(DateUtils.getNowDate());
        wmsStreamHost.setTenantId(SecurityUtils.getLoginUser().getTenantId());
        return wmsStreamHostMapper.updateWmsStreamHost(wmsStreamHost);
    }

    /**
     * 批量删除直播间主播
     * 
     * @param ids 需要删除的直播间主播主键
     * @return 结果
     */
    @Override
    @DataScope(tenantAlias = "t", userAlias = "u")
    public int deleteWmsStreamHostByIds(Long[] ids)
    {
        return wmsStreamHostMapper.deleteWmsStreamHostByIds(ids);
    }

    /**
     * 删除直播间主播信息
     * 
     * @param id 直播间主播主键
     * @return 结果
     */
    @Override
    @DataScope(tenantAlias = "t", userAlias = "u")
    public int deleteWmsStreamHostById(Long id)
    {
        return wmsStreamHostMapper.deleteWmsStreamHostById(id);
    }
}
